home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / program / qbsvga.zip / QBSVGA.TXT < prev    next >
Text File  |  1996-08-21  |  29KB  |  530 lines

  1.  
  2.  
  3.  
  4.                         QBSVGA, version 3.1
  5.  
  6.      "QBSVGA" is a set of subroutines/functions (and an "include file")
  7. that can be used within QB programs to achieve SVGA graphic capability.
  8. Much, but not all, of the standard QB graphic routines are emulated.  To
  9. be specific, the QBSVGA routines work best when the video system is not
  10. just SVGA-capable, but VESA-aware as well.  (I have yet to encounter an
  11. SVGA-equipped system that is not VESA-aware, but I understand they exist.)
  12. There are included stand-alone routines, VS.EXE and VS1.EXE, that you can
  13. use to determine whether or not your system is VESA-aware and what video
  14. modes you have support for.  See VS.TXT for more information concerning
  15. these routines.  Whether or not a VESA bios is present on your SVGA card,
  16. you must not only have hardware support for the video mode you want to
  17. use, it must be supported by your VESA bios as well.  (It's entirely
  18. possible to have support in hardware for a video mode that your bios
  19. cannot itself access.  The routines supplied here do not use direct
  20. hardware access, as opposed to the intrinsic QB graphic routines.)  Further,
  21. for the software to auto-detect a VESA video mode, your VESA bios must
  22. provide the so-called extended information about that mode.  (VS1 will
  23. tell you whether or not this information is available.  If VS1 informs
  24. you that such information is unavailable for any given mode, there is not
  25. necessarily any reason to worry.  If QBSVGA fails to find such information
  26. for any one particular mode, it will simply look for another one.)
  27.  
  28.      Most of the documentation regarding the QBSVGA routines can be found
  29. by reading the comments associated with each subroutine/function in
  30. QBSVGA.BAS.  This file simply makes some general comments and lists the
  31. functionallity provided by QBSVGA.  QBSVGA gives you access to up to 12
  32. different SVGA modes/resolutions:
  33.  
  34.  
  35.     MODE = 14:   640 x  480 x 256
  36.     MODE = 15:   800 x  600 x  16
  37.     MODE = 16:   800 x  600 x 256
  38.     MODE = 17:  1024 x  768 x  16
  39.     MODE = 18:  1024 x  768 x 256
  40.     MODE = 19:  1200 x 1024 x  16
  41.     MODE = 20:  1200 x 1024 x 256
  42.     MODE = 21:  1600 x 1200 x  16
  43.     MODE = 22:  1600 x 1200 x 256
  44.     MODE = 23:   132 x   25 x  16 (text)
  45.     MODE = 24:   132 x   43 x  16 (text)
  46.     MODE = 25:   132 x   50 x  16 (text)
  47.  
  48.  
  49. The mode integers listed above are the "QB-type" integers that you would
  50. input to QBSVGA's analog of QB's screen statement.  They are not necessarily
  51. the actual hex numbers that your bios references (i.e., the video mode
  52. specifiers that QBSVGA, via its subroutine FINDVESA, attempts to auto-
  53. detect).  Except for 0, and assuming that auto-detection works, if you try
  54. to use a QB-type mode not specified above, you'll get an 800 x 600 x 16 mode
  55. (if support for it can be found).  (Using a mode of 0 produces the same
  56. effect as QB's SCREEN 0 statement.)
  57.  
  58.  
  59.  
  60.      The general method of using QBSVGA is to put the contents of
  61. REGTYPE.INC at the top of your program, write your program, calling any
  62. and whichever of the QBSVGA routines you need, and then put the contents of
  63. QBSVGA.BAS at the bottom of your program.  When you go to link your
  64. compiled program, be sure and use the auxiliary library QB.LIB in addition
  65. to whatever libraries you normally link with.
  66.  
  67.      The usage syntax of the routines is similar to that with the
  68. corresponding internal QB routines.  The QBSVGA routine names are prefixed
  69. with a "B" (for "bios") to distinguish them from their intrinsic QB
  70. analogs.  (For the few routines provided that do not emulate specific QB
  71. functions, this convention isn't necessarily followed.  Another exception
  72. is MPUT/MGET, previously named BGET/BPUT.  There are now *new* BPUT/BGET
  73. subroutines.)  One difference between the intrinsic and QBSVGA routines is
  74. that you must not leave out parameters unimportant to you in the calls to the
  75. QBSVGA routines.  Another difference is that, except for functions BPOINT and
  76. BPOS, these routines must be accessed via QB's CALL statement.  You can put
  77. DECLARE statements at the top of your program if you wish to avoid this
  78. detail, but there is still the matter of enclosing the arguments/parameters
  79. in parentheses.  Except for various character string inputs (which should be
  80. obvious), all data passed to the routines should be of type single precision
  81. (real).  (BPOINT and QRYMOUSE *return* 2-byte integers.)  Example MAIN
  82. routines, SIM.BAS, MOUSDEMO.BAS, and PRTEST.BAS are included to show the
  83. basic usage of the routines.  (You may of course wish to read the commentary
  84. and inspect the SUB/FUNCTION statements themselves in QBSVGA.BAS.)
  85.  
  86.      The rest of this file gives a basic description of the different
  87. routines supplied in QBSVGA.BAS.
  88.  
  89.  
  90. SUB BSCREEN:  analog of QB's SCREEN statement
  91.               (QB's SCREEN function is not emulated here.  BSCREEN will
  92.               not change the video mode if the screen is already in the
  93.               mode you're requesting.  In this situation, BSCREEN serves
  94.               merely to change active and displayed video pages.
  95.               Exceptions to this are when your inputting a video mode of 0
  96.               to BSCREEN, to achieve the same effect as QB's SCREEN 0
  97.               statement, or when auto-mode detection failed and you get
  98.               prompted for the bios video mode to use--see below.  BSCREEN
  99.               should be called before any of the other routines--and then
  100.               again with a QB-type mode of 0 when you're all done.)
  101.  
  102. SUB BPSET:  analog of QB's PSET statement
  103.  
  104. SUB BLINE:  analog of QB's LINE statement
  105.             (QB's style option is not supported.)
  106.  
  107. SUB BCIRCLE:  analog of QB's CIRCLE statement
  108.  
  109. SUB BCLS:  analog of QB's CLS 0 and CLS 1 statements
  110.            (CLS 2 is not supported.)
  111.  
  112. SUB BCOLOR:  analog of QB's COLOR statement
  113.  
  114.  
  115.  
  116. SUB BLOCATE:  analog of QB's LOCATE statement
  117.               (LOCATE's cursor control options are not included.)
  118.  
  119. SUB BPRINT:  analog of QB's PRINT statement
  120.              (See QBSVGA.BAS for discussion of differences in how this
  121.              routine formats output.)
  122.  
  123. FUNCTION BPOINT%:  analog of QB's POINT function
  124.                    (Note that BPOINT is a 2-byte INTEGER.)
  125.  
  126. SUB BVIEW:  analog of QB's graphics VIEW statement
  127.             (The SCREEN option of VIEW is not supported and its performance
  128.             is somewhat limited when its border encroaches on a screen edge.)
  129.  
  130. SUB BPAINT:  a not necessarily exact analog of QB's PAINT statement
  131.              (You should be able to use this subroutine to achieve the
  132.              same results that PAINT would give if it applied to SVGA
  133.              video modes.  However, especially when painting the exterior
  134.              of objects, you may need to make multiple calls to BPAINT
  135.              with different (x,y) inputs.  Also, painting only occurs in
  136.              regions in which the pixel color is the same as the background.
  137.              The background color is either 0 or it is the color of whatever
  138.              the viewport (if active) was filled with.  (PAINT's tiling option
  139.              is not supported.)  Also, BPAINT may at times perform better if
  140.              the coordinate you specify isn't directly adjacent to a pixel
  141.              bordering the area you're painting.  These slight idiosyncracies
  142.              are perhaps offset by a difference between BPAINT and PAINT
  143.              that may make BPAINT somewhat better.  PAINT will not let you,
  144.              for example, paint the inside of a circle with a different color
  145.              than used to draw the circle.  If you try, the painting will
  146.              progress outside of the circle until pixels of the painting
  147.              color or the screen/viewport edge are encountered.  BPAINT
  148.              doesn't perform that way.  BPAINT has no problems with your
  149.              drawing a circle (or any closed object) with one color and
  150.              painting its interior with an another.)
  151.  
  152. FUNCTION BPOS:  an emulation of QB's POS *and* CRSLIN functions
  153.                 (The current line, or row, is returned via the argum